x86, hvm: Fix issue with user-mode writes to read-only memory.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jul 2008 12:24:57 +0000 (13:24 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jul 2008 12:24:57 +0000 (13:24 +0100)
commite8ea651a7a504a7307d22fbbb06dfcb39204cbd3
tree01fa9c5b36ac85eda7fc4a4fd70f9dd74d6892ab
parent8d375aa1744b012e9139a9fe3d560c61bb1fe437
x86, hvm: Fix issue with user-mode writes to read-only memory.

This patch fixes an issue where a guest could get stuck if a write to
memory marked p2m_ram_ro happened from user mode. It would get
misinterpreted as a user-mode page-table write, and the "dummy write"
emulation necessary to skip over the instruction never got done. In
looking into this, I also discovered that the user-mode page-table
check is done in two places, the second (in emulate_map_dest) of which
can never be reached and is just a waste of cycles. Tim Deegan
requested that rather than completely removing that code, I'd leave it
in for debug-builds with an added warning-print.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
xen/arch/x86/mm/shadow/multi.c